using System;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DM.Entity;

namespace DM.Web
{
    public partial class ViewListUl : System.Web.UI.UserControl
    {
        private List<TinTuc> listTin = new List<TinTuc>();
        public List<TinTuc> ListTin
        {
            set { listTin = value; }
            get { return listTin; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GenList();
                //DataList1.DataSource = ListTin;
                //DataList1.DataBind();
            }
        }

        private void GenList()
        {           
            if (listTin.Count>0)
            {
                list.InnerHtml += "<ul>";
                foreach (TinTuc tinTuc in listTin)
                {
                    list.InnerHtml += "<li>";
                    list.InnerHtml += "<img src=\"../Images/dot2.png\" alt=\"\" style=\"margin-right:8px;\"/>";
                    list.InnerHtml += "<a href=\"../TrangTinTuc.aspx?id="+tinTuc.Ma.ToString()+"\">"+tinTuc.Tieude+"</a>";
                    list.InnerHtml += "</li>";
                }
                list.InnerHtml += "</ul>";
            }
        }
    }
}